package com.bhf.constant;

import lombok.Getter;

/**
 * @author pwq
 */
@Getter
public enum ResultCodeEnum {

    /**
     * Common code.
     **/
    SUCCESS(200, "处理成功"),
    ERROR(500, "服务器内部错误"),
    AUTHENTICATION_ERROR(401, "用户名或者密码输入错误，请重新输入!"),
    AUTHENTICATION_INFO_ERROR(401, "认证信息错误，请重新认证"),
    AUTHENTICATION_INFO_EXPIRED(401, "凭据信息过期，请重新认证"),
    AUTHENTICATION_IS_REQUIRED(401, "凭据信息不能为空，请重新认证"),

    /**
     * Config use 100001 ~ 100999.
     **/
    NAMESPACE_NOT_EXIST(100001, "目标 namespace 不存在"),

    CONNECT_TIMEOUT_ERROR(100007, "服务连接超时"),
    NOT_KNOWN_INDEX_ERROR(100008, "找不到相关的索引"),

    METADATA_ILLEGAL(100002, "导入的元数据非法"),

    DATA_VALIDATION_FAILED(100003, "未读取到合法数据"),

    PARSING_DATA_FAILED(100004, "解析数据失败"),

    DATA_EMPTY(100005, "导入的文件数据为空"),

    NO_SELECTED_CONFIG(100006, "没有选择任何配置");

    ResultCodeEnum(int code, String codeMsg) {
        this.code = code;
        this.msg = codeMsg;
    }
    private int code;

    private String msg;
}
